{template 'user/head.html'}
<div id="position">
<a href="javascript :history.back(-1)" title="返回上一页"><img alt="返回上一页" src="{$base_url}/images/user/undo.gif" style="float:right;" /></a>当前位置：编辑内容
</div>

<div class="padding10">
<img src="{$base_url}/images/user/wj.gif" style="margin-right:10px;" />欢迎来到编辑页面。您可以编辑网站内容，展示网站信息。您可以填写不同的内容网页标题，配合关键词以便更好的SEO页面。
</div>

<div class="blank10"></div>

<script language="javascript" src="{$base_url}/common/js/common.js"></script>

<script>

function checkform() {
if(!document.form1.title.value) {
alert('请填写标题');
return false;
}
if(!document.form1.typeid.value) {
alert('请选择栏目');
return false;
}
return true;
}
</script>


<!--phpox1110 会员前台不能发布问题 -->
<form method="post" name="form1" action="<?php if(front::$act=='edit') $id="/id/".$data[$primary_key]; else $id=''; echo modify("/act/".front::$act."/manage/".$manage.$id);?>" enctype="multipart/form-data" onsubmit="return checkform();">

<script type="text/javascript" src="{$base_url}/common/js/jquery-1.2.6.min.js"></script>
<script type="text/javascript" src="{$base_url}/common/js/ajaxfileupload.js"></script>
<script type="text/javascript" src="{$base_url}/common/js/ThumbAjaxFileUpload.js"></script>
<link rel="stylesheet" href="{$base_url}/common/js/jquery/ui/ui.datepicker.css" type="text/css" media="screen" title="core css file" charset="utf-8" />
<script language="javascript" src="{$base_url}/common/js/jquery/ui/ui.datepicker.js"></script>

<script>
function attachment_delect(id) {
$.ajax({
url: '{url('tool/deleteattachment',false)}&id='+id,
type: 'GET',
dataType: 'text',
timeout: 1000,
error: function(){
//	alert('Error loading XML document');
},
success: function(data){
document.form1.attachment_id.value=0;
get('attachment_path').innerHTML='';
get('file_info').innerHTML='';
}
});
}
</script>

<script language="JavaScript">
var number=10; //定义条目数

function lmYC()
	{
var lbmc;
    for (i=1;i<=number;i++)
		{
        lbmc = eval('lm' + i);
        lbmc.style.display = 'none';
    }
}
 
function ShowFLT(i) 
	{
    lbmc = eval('lm' + i);
    if (lbmc.style.display == 'none') 
		{
        lmYC();
        lbmc.style.display = '';
    }
    else {
        lbmc.style.display = 'none';
    }
}
</script>

<div class="hid_box">
<strong>所属类别</strong>
<div class="hbox" style="background:none;">
{form::getform('typeid',$form,$field,$data)}  <font color="red">*</font>
</div>
</div>


<div class="hid_box">
<strong>标题</strong>
<div class="hbox" style="background:none;">
{form::getform('title',$form,$field,$data)}  <font color="red">*</font>
</div>
</div>


<div class="hid_box">
<strong>正文</strong>
<div class="hbox" style="background:none;">
{form::getform('content',$form,$field,$data)} 
</div>
</div>

<strong>内容扩展</strong>

<div class="hid_box">
<h5><a onClick=javascript:ShowFLT(1) href="javascript:void(null)">META信息</a></h5>
<div id=lm1 class="hbox" style="display: none">
网页标题：<br />{form::getform('mtitle',$form,$field,$data)}<br /><br />
关&nbsp;键&nbsp;&nbsp;词 (keywords)：<br />{form::getform('keyword',$form,$field,$data)}<br /><br />
页面描述 (description)：<br />{form::getform('description',$form,$field,$data)}<br /><br />
内容简介长度：<br />{form::getform('introduce_len',$form,$field,$data)}<br />
{form::getform('introduce',$form,$field,$data)} 
</div>
</div>

<div class="hid_box">
<h5><a onClick=javascript:ShowFLT(2) href="javascript:void(null)">缩略图</a></h5>
<div id=lm2 class="hbox" style="display: none">
{form::getform('image',$form,$field,$data)} 
</div>
</div>

<div class="hid_box">
<h5><a onClick=javascript:ShowFLT(3) href="javascript:void(null)">审核</a></h5>
<div id=lm3 class="hbox" style="display: none">
{form::getform('checked',$form,$field,$data)} <div class="clear"></div>
</div>
</div>

<div class="hid_box">
<h5><a onClick=javascript:ShowFLT(4) href="javascript:void(null)">模板</a></h5>
<div id=lm4 class="hbox top" style="display: none">
选择模板：<br />
{form::getform('template',$form,$field,$data)} 
<br /><br />
URL规则：<br />
{form::getform('htmlrule',$form,$field,$data)}
<br /><br />
生成HTML：<br />
{form::getform('ishtml',$form,$field,$data)} 
</div>
</div>

<div class="hid_box">
<h5><a onClick=javascript:ShowFLT(5) href="javascript:void(null)">外部链接</a></h5>
<div id=lm5 class="hbox" style="display: none">
{form::getform('linkto',$form,$field,$data)} 
</div>
</div>

<div class="hid_box">
<h5><a onClick=javascript:ShowFLT(6) href="javascript:void(null)">推荐位设置</a></h5>
<div id=lm6 class="hbox top" style="display: none">
{form::getform('arcatt1',$form,$field,$data)}
</div>
</div>


<div class="hid_box">
<h5><a onClick=javascript:ShowFLT(7) href="javascript:void(null)">自定义字段</a></h5>
<div id=lm7 class="hbox" style="display: none">
<table>
{loop $field $f}
<?php
$name=$f['name'];
if(!eregi('^my_',$name)) {
    unset($field[$name]);
    continue;
    }
if(!isset($data[$name])) $data[$name]='';
 ?>
<tr>
    <td class="left" width="40%"><?php echo setting::$var['archive'][$name]['cname']; ?></td>
    <td width="60%">
        <?php echo form::getform($name,$form,$field,$data); ?>
    </td>
</tr>
{/loop}
</table>
</div>
</div>

<div class="hid_box">
<h5><a onClick=javascript:ShowFLT(8) href="javascript:void(null)">附件</a></h5>
<div id=lm8 class="hbox" style="display: none">
<span id="file_info" style="color:red"></span><br>
<input type="hidden" name="attachment_id"  id="attachment_id" value="{=archive_attachment(@$data['aid'],'id')}" size="50"/>
描述：<input type="text" name="attachment_intro"  id="attachment_intro" value="{=archive_attachment(@$data['aid'],'intro')}" size="50"/><br><br>
保存路径：<span id="attachment_path">{=archive_attachment(@$data['aid'],'path')}</span> <input type="button" name="delbutton" value="删除" onclick="attachment_delect(get('attachment_id').value)"><br><br>
<?php if(front::$act=='edit' && $data['attachment_id']) { ?>
更改：<?php } ?>

上传：<input type="file" name="fileupload" id="fileupload" style="width:400px" />
&nbsp;&nbsp;<input type="button" name="filebuttonUpload"  id="filebuttonUpload" onclick="return ajaxFileUpload('fileupload','{url('tool/uploadfile',false)}','#uploading');" value="上传" />
<img id="uploading" src="{$base_url}/common/js/loading.gif" style="display:none;">
</div>
</div>


<div class="hid_box">
<h5><a onClick=javascript:ShowFLT(9) href="javascript:void(null)">投票</a></h5>
<ul id=lm9 class="hbox" style="display: none">
开发中……
            <!-- <?php for($i=1;$i<=8;$i++) { ?>
            <li>{$i} &nbsp; 标题 {form::input("vote[$i]",vote::title(@$data['aid'],$i))}
                &nbsp; 图片url {form::input("vote_image[$i]",vote::img(@$data['aid'],$i))}
            <?php } ?>-->
</ul> 
</div>


<div class="hid_box">
<h5><a onClick=javascript:ShowFLT(10) href="javascript:void(null)">限权</a></h5>
<div id=lm10 class="hbox" style="display: none">
<table width="90%">
<tr><td width="20%">&nbsp;</td>
<td  width="35%">浏览(<font color="Red">×</font>)</td>
<td  width="35%">下载附件(<font color="Red">×</font>)</td>
</tr>
{loop usergroup::getInstance()->group $group}
<?php if($group['groupid']=='888') continue; ?>
<tr><td>{$group.name}</td>
<td>{form::checkbox("_ranks[".$group['groupid']."][view]",-1, @$data['_ranks'][$group['groupid']]['view'])}</td>
<td>{form::checkbox("_ranks[".$group['groupid']."][down]",-1, @$data['_ranks'][$group['groupid']]['down'])}</td>
</tr>
{/loop}
</table>
</div> 

</div>



<div class="blank20"></div>
<input type="submit" name="submit" value="提交" class="button"/>

</form>

{template 'user/foot.html'}